package gameView;

import model.Coordinate;
import model.entity.AnimatedEntity2D;
import model.entity.Entity2D;
import model.spawner.Spawner2D;
import graphic.GameView;
import graphic.render.Render2D;

/**
 * Specializzazione della classe {@link GameView} dedicata al SinglePlayer.
 * @author Jan
 *
 */
public class TestGameView extends GameView {

	private static final long serialVersionUID = -3225191352598072020L;
	
	//Di supporto
	private Spawner2D spawner;
	private Entity2D[] entities;
	
	private Entity2D userShip = new AnimatedEntity2D(0, Coordinate.INITIAL_SHIP_2D_COORDINATE, 0) {
		@Override
		public boolean perform() {
			return false;
		}
		
		@Override
		public boolean haveChild() {
			return false;
		}
	};

	
	public TestGameView(Render2D render) {
		super(render);
			
		//TODO "costruire" la modalia'
		
	}

	@Override
	public void tick(Render2D renderScreen) {
		renderScreen.cleanRenderArea();
		entities = spawner.cloneActalEntityBuffer();
		
		for (int i = 0; i < entities.length; i++) {
			if (entities[i] != null) {
				renderScreen.centredRender( entities[i] );
			}
		}
		renderScreen.centredRender( userShip );
	}

}
